<%-- 
    Document   : listPartner
    Created on : Jul 13, 2013, 1:28:10 PM
    Author     : jitendra
--%>


<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@include file="../common/script.jsp" %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <%@include file="../common/title.jsp" %>
    </head>
    <body onLoad="yav.init('form1',rules,'inline');">
        <%@include file="../common/header.jsp" %>
        <%@include file="../common/menu.jsp" %>
        <div class="in_02" >
            <%@include file="../common/message.jsp" %>
            <form:form id="form1" modelAttribute="partner" action="listPartner.htm" method="POST">
                <fieldset>
                    <legend>List Partner</legend>
                    <table class="formTable">
                        <tr>
                            <td>Clinic:<form:select path="HealthSpringCenter.centerId" id="centerId" cssClass="userInputLarge">
                                    <form:option value="" label="-"></form:option>
                                    <form:options itemLabel="centerName" itemValue="centerId" items="${HealthSpringCenter}"></form:options>
                                </form:select></td>
                            <td>Partner Type:<form:select path="PartnerType.partnerTypeId" id="partnerTypeId" cssClass="userInputLarge">
                                    <form:option value="" label="-"></form:option>
                                    <form:options itemLabel="partnerType" itemValue="partnerTypeId" items="${PartnerType}"></form:options>
                                </form:select></span></td>
                            <td><br/><input type="submit" name="btnSubmit" class="userInputFormSubmit" value="Go" /></td>
                        </tr>                        
                    </table>

                    <spring:hasBindErrors name="partner">
                        <div class="error">
                            <form:errors path="*"/>
                        </div>
                    </spring:hasBindErrors>
                </fieldset>
            </form:form>

            <table>
                <tr><td>
                        &nbsp;&nbsp;&nbsp; <c:out value="${fn:length(partnerList)}"/> <spring:message code="rowsFound"/>
                        <br/><br/>
                        <sec:authorize ifAnyGranted="ROLE_BF_PARTNER_ADD">
                            &nbsp;&nbsp;&nbsp; <span style="font-size: 15px; font-weight: bold;"><a href="../partner/addPartner.htm">Add Partner</a></span> 
                        </sec:authorize>
                    </td></tr>
            </table>
            <form:form id="form1" modelAttribute="partner" action="listPartner.htm" method="POST">
                <table class="data_table" border="1px">
                    <thead>
                        <tr class="header">
                            <td align="center">Sr.No.</td>
                            <td align="center">Name</td>
                            <td align="center">Address</td>
                            <td align="center">Phone</td>
                            <td align="center">Contact Person 1 Name</td>
                            <td align="center">Contact Number</td>
                            <td align="center">Contact Person 2 Name</td>
                            <td align="center">Contact Number</td>
                            <td align="center">Contact Person 3</td>
                            <td align="center">Contact Number</td>
                            <td align="center">Description</td>
                            <td align="center">Center</td>
                            <td align="center">Partner Type</td>
                        </tr>
                    </thead>
                    <c:forEach items="${partnerList}" var="PartnerItem" varStatus="status">
                        <tr>
                            <td align="center">${status.count}</td>
                            <td align="center"><c:out value="${PartnerItem.partnerDetail.name}"/></td>
                            <td align="center"><c:out value="${PartnerItem.partnerDetail.address}"/></td>
                            <td align="center"><c:out value="${PartnerItem.partnerDetail.phone}"/></td>
                            <td align="center"><c:out value="${PartnerItem.partnerDetail.contact1Person}"/></td>
                            <td align="center"><c:out value="${PartnerItem.partnerDetail.contact1Number}"/></td>
                            <td align="center"><c:out value="${PartnerItem.partnerDetail.contact2Person}"/></td>
                            <td align="center"><c:out value="${PartnerItem.partnerDetail.contact2Number}"/></td>
                            <td align="center"><c:out value="${PartnerItem.partnerDetail.contact3Person}"/></td>
                            <td align="center"><c:out value="${PartnerItem.partnerDetail.contact3Number}"/></td>
                            <td align="center"><c:out value="${PartnerItem.partnerDetail.description}"/></td>
                            <td align="center"><c:out value="${PartnerItem.healthSpringCenter.centerName}"/></td>
                            <td align="center"><c:out value="${PartnerItem.partnerType.partnerType}"/></td>
                            <sec:authorize ifAnyGranted="ROLE_BF_PARTNER_EDIT">
                                <td>                            
                                    <a href="editPartner.htm?partnerID=${PartnerItem.partnerID}"/><img src="../images/edit.png"  width="20" height="20" style="border: none" alt="Edit" title="Edit"/></a></td>
                                </sec:authorize>
                        </tr>
                    </c:forEach>
                </table>
            </form:form>
            &nbsp;&nbsp;&nbsp; <c:out value="${fn:length(partnerList)}"/> <spring:message code="rowsFound"/>
            <br/><br/>
            <sec:authorize ifAnyGranted="ROLE_BF_PARTNER_ADD">
                &nbsp;&nbsp;&nbsp; <span style="font-size: 15px; font-weight: bold;"><a href="../partner/addPartner.htm">Add Partner</a></span> 
            </sec:authorize>
        </div>
    </body>
</html>

